package com.wyx.wyxmember.message;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class Sender {

    @Autowired
    private AmqpTemplate rabbitmqTemplate;

    public void send(){
        String content = "hello" + new Date().toString();
        System.out.println("Sender:" +content);
        //this.rabbitmqTemplate.convertAndSend("hello", content);

        rabbitmqTemplate.convertAndSend("myElectronics","comput",content);

    }
}